#include testing
#include lists
#include numbers

(assert-eq 1...5
	   '(1 2 3 4 5)
	   (... 1 5))

(assert-eq 1..5
	   '(1 2 3 4)
	   (.. 1 5))

(assert-eq map1
	   (... 1 5)
	   (map (lambda (x) (+ 1 x))
		(... 0 4)))

(assert-eq map2
	   '()
	   (map (lambda (x) (+ 1 x))
		'()))

(assert-eq length-0 0 (length '()))
(assert-eq length-1 1 (length '(0)))
(assert-eq length-2 2 (length '(3 5)))

(assert-eq sum-0 0 (sum '()))
(assert-eq sum-1 1 (sum '(1)))
(assert-eq sum-10 10 (sum '(1 2 3 4)))

(assert-eq filter-positive
	   (... 1 5)
	   (filter positive? (... -5 5)))

(assert all? (all? positive? (... 1 5)))
(assert-false all?-false (all? positive? (... -1 5)))

(assert any? (any? positive? (... 1 5)))
(assert-false any? (any? negative? (... 1 5)))

